<template>
  <commonCard :titleArr="titleArr" :currnetId="currnetId" @setId="setId">
    <account-settings v-if="currnetId == 1"></account-settings>
    <service-switch v-else-if="currnetId == 2"></service-switch>
    <service-settings v-else-if="currnetId == 3"></service-settings>
  </commonCard>
</template>
<script>
import commonCard from "@/components/common/commonCard.vue";
import accountSettings from "@/components/setting/accountSettings.vue";
import serviceSwitch from "@/components/setting/serviceSwitch.vue";
import serviceSettings from "@/components/setting/serviceSettings.vue";
export default {
  components: {
    accountSettings,
    commonCard,
    serviceSwitch,
    serviceSettings,
  },
  data() {
    return {
      currnetId: 1,
      titleArr: [
        {
          id: 1,
          name: "账号设置",
        },
        {
          id: 2,
          name: "服务开关",
        },
        {
          id: 3,
          name: "服务设置",
        },
      ],
    };
  },
  methods: {
    setId(i) {
      this.currnetId = i;
    },
  },
};
</script>